/*
 * @Author: your name
 * @Date: 1970-01-01 08:00:00
 * @LastEditTime: 2020-08-24 22:52:35
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /Linux系统编程/pthread_kill.c
 */
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <signal.h>
void *func(void *arg)
{
    sleep(1);
    printf("new thread\n");
    return NULL;
}

int main(void)
{
    pthread_t tid = pthread_create(&tid, NULL, func, NULL);

    int s = pthread_kill(tid, SIGKILL);
    printf("s = %d\n", s);

    pthread_join(tid, NULL);


    return 0;
}